package com.jzlin.funhub.admin.model.resp;

import cn.hutool.core.bean.BeanUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jzlin.funhub.admin.model.entity.Question;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 问题详情.
 *
 * @author linjz
 * @since 2025/7/4
 */
@Data
@ApiModel
public class QuestionDetailResp {
    @ApiModelProperty("问题id")
    private Long id;

    @ApiModelProperty("问题标题")
    private String title;

    @ApiModelProperty("摘要")
    private String summary;

    @ApiModelProperty("内容")
    private String content;

    @ApiModelProperty("所属分类")
    private String categoryName;

    @ApiModelProperty("状态")
    private Integer status;

    @ApiModelProperty("浏览量")
    private Long viewCount;

    @ApiModelProperty("回答量")
    private Long answerCount;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("创建人")
    private String createBy;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty("收藏量")
    private Long starCount;


    public QuestionDetailResp(Question question) {
        BeanUtil.copyProperties(question, this);
    }
}
